//
//  FindDetailCell.m
//  ToYourHeartNews
//
//  Created by XJing on 16/1/22.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥. All rights reserved.
//

#import "FindDetailCell.h"

@implementation FindDetailCell
- (void)dealloc
{
    [_userImg release];
    [_userLable release];
    [_timeLable release];
    [_contentLable release];
    [_picture release];
    [_hotImg release];
    [_hotLabel release];
    [_messageImg release];
    [_messageLable release];
    [_likeImg release];
    [_likeLable release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.userImg = [[UIImageView alloc]init];
//        _userImg.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_userImg];
        
        self.userLable = [[UILabel alloc]init];
//        _userLable.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:_userLable];
        
        self.timeLable = [[UILabel alloc]init];
//        _timeLable.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:_timeLable];
        
        self.contentLable = [[UILabel alloc]init];
//        _contentLable.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_contentLable];
        
        self.picture = [[UIImageView alloc]init];
//        _picture.backgroundColor = [UIColor blueColor];
        [self.contentView addSubview:_picture];
        
        self.hotImg = [[UIImageView alloc]init];
//        _hotImg.backgroundColor = [UIColor magentaColor];
        [self.contentView addSubview:_hotImg];
        
        self.hotLabel = [[UILabel alloc]init];
//        _hotLabel.backgroundColor = [UIColor cyanColor];
        [self.contentView addSubview:_hotLabel];
        
        self.messageImg = [[UIImageView alloc]init];
//        _messageImg.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_messageImg];
        
        self.messageLable = [[UILabel alloc]init];
//        _messageLable.backgroundColor = [UIColor blackColor];
        [self.contentView addSubview:_messageLable];
        
        self.likeImg = [[UIImageView alloc]init];
//        _likeImg.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:_likeImg];
        
        self.likeLable = [[UILabel alloc]init];
//        _likeLable.backgroundColor = [UIColor lightGrayColor];
        [self.contentView addSubview:_likeLable];
        
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _userImg.frame = CGRectMake(5, 10, self.contentView.frame.size.width / 10, self.contentView.frame.size.width / 10);
    _userImg.layer.cornerRadius = self.contentView.frame.size.width / 18;
    _userImg.clipsToBounds = YES;
    
    _userLable.frame = CGRectMake(_userImg.frame.origin.x + _userImg.frame.size.width + 5, _userImg.frame.origin.y, self.contentView.frame.size.width / 2, _userImg.frame.size.height / 3 * 2);
    _userLable.font = [UIFont systemFontOfSize:16];
    _userLable.textColor = [UIColor blueColor];
    
    _timeLable.frame = CGRectMake(_userLable.frame.origin.x, _userLable.frame.origin.y + _userLable.frame.size.height + 2, _userLable.frame.size.width, _userImg.frame.size.height / 3);
    _timeLable.font = [UIFont systemFontOfSize:12];
    _timeLable.textColor = [UIColor grayColor];
    
    _contentLable.frame = CGRectMake(_userImg.frame.origin.x, _userImg.frame.origin.y + _userImg.frame.size.height + 10, self.contentView.frame.size.width - 10, 100);
    _contentLable.numberOfLines = 0;
    _contentLable.font = [UIFont systemFontOfSize:15];
    
    _picture.frame = CGRectMake(0, _contentLable.frame.origin.y + _contentLable.frame.size.height + 5, self.contentView.frame.size.width, 200);
    
    _hotImg.frame = CGRectMake(20, _picture.frame.origin.y + _picture.frame.size.height + 10, 20, 20);
    _hotImg.image = [UIImage imageNamed:@"iconfont-hot"];
    
    _hotLabel.frame = CGRectMake(_hotImg.frame.origin.x + _hotImg.frame.size.width + 5, _hotImg.frame.origin.y, 50, 20);
    
    _messageImg.frame = CGRectMake(self.contentView.frame.size.width / 2 - 10, _hotImg.frame.origin.y, _hotImg.frame.size.width, _hotImg.frame.size.height);
    _messageImg.image = [UIImage imageNamed:@"iconfont-message"];
    
    _messageLable.frame = CGRectMake(_messageImg.frame.origin.x + _messageImg.frame.size.width + 5, _messageImg.frame.origin.y, 50, 20);
    
    _likeImg.frame = CGRectMake(self.contentView.frame.size.width / 7 * 6, _hotImg.frame.origin.y, 20, 20);
    _likeImg.image = [UIImage imageNamed:@"iconfont-zan"];
    
    _likeLable.frame = CGRectMake(_likeImg.frame.origin.x + _likeImg.frame.size.width + 5, _likeImg.frame.origin.y, 50, 20);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
